package com.lagou.edu.course.api;

import com.lagou.edu.course.api.dto.MediaDTO;
import com.lagou.edu.course.api.dto.VideoPlayDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * TODO
 *
 * @author lm
 * @since 2021/11/1 16:28
 */
@FeignClient(value = "edu-course-boot", path = "/course/media")
public interface MediaRemoteService {
    @GetMapping(value = "/getMediaByLessonId")
    MediaDTO getMediaByLessonId(@RequestParam("lessonId") Integer lessonId);

    /**
     * 更新或者保存媒体
     */
    @PostMapping("/updateOrSaveMedia")
    void updateOrSaveMedia(@RequestBody MediaDTO courseMediaDTO);

    /**
     * 获取是媒体播放信息
     */
    @GetMapping("/getVideoPlayInfo")
    VideoPlayDto getVideoPlayInfo(@RequestParam("lessonId") Integer lessonId, @RequestParam(required = false, value = "userId") Integer userId);
}
